package com.listener;

import com.event.MyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

/**
 * Copyright (c)  by www.leya920.com
 * All right reserved.
 * Create Date: 2021-01-03 10:53
 * Create Author: xuweiwei
 * File Name: MyListener.java
 * Last version:  1.0
 * Function: //TODO
 * Last Update Date: 2021-01-03 10:53
 * Last Update Log:
 * Comment: //TODO
 **/
@Component  // 需要注册为一个bean
public class MySecondListener implements ApplicationListener<MyEvent> {

	@Override
	public void onApplicationEvent(MyEvent event) {

		System.out.println("MySecondListener 监听器获取容器中初始化bean的数量:"+event.getMessage());
	}
}
